<template>
  <div class="tableImg">
    <img :src="scope.text" alt="" @click="handlePreview(scope.text)" />
    <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
      <img alt="example" style="width: 100%" :src="previewImage" />
    </a-modal>
  </div>
</template>

<script>
export default {
  props: {
    instance: Object,
    scope: Object // text, index, scope
  },
  data() {
    return {
      previewVisible: false,
      previewImage: ''
    }
  },
  mounted() {
    
  },
  methods: {
    async handlePreview(file) {
      if (file) {
        this.previewImage = file
        this.previewVisible = true
      }
    },
    handleCancel() {
      this.previewVisible = false
    }
  }
}
</script>
